This invention relates to text processing methods and text processor apparatus forming an imaging system for generating, storing, displaying, drawing, printing and otherwise imaging text, symbols, icons, and other patterns, all generically known as xe2x80x9cglyphsxe2x80x9d.
A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
Text processors are well-known in the field of computers and data processors for imaging characters in fonts of different typefaces and sizes. Text processors typically define text characters with a generic definition in a character table, for example, an ASCII table, which is independent of typeface or size. The term xe2x80x9ctypefacexe2x80x9d refers to the general appearance and design of characters and the term xe2x80x9cfontxe2x80x9d refers to a complete set of characters having the same typeface, that is, the same general appearance and design.
Computers and data processors that use text processors are image systems that output the processed text in human readable form. The image systems typically include computer display screens for electronic output or printers for paper output. In such image systems, each character is drawn by a number of pixels (dots) that are located and addressed by an X-axis coordinate and a Y-axis coordinate defined relative to an XY-axes system where an X-axis and an orthogonal Y-axis form a matrix of addressable pixels. Each pixel is drawn by determining the X-axis and Y-axis coordinates for the pixel and each character is drawn by determining the X-axis and Y-axis coordinates for all the pixels that are used to draw the character. The XY-axes system can have any arbitrary rotation. Typically for printers, the X-axis is across the page so that the Y-axis is down the page as read by a human viewer.
For text processors, characters are typically defined along the X-axis by a character line where many character lines for text define a page of text. Each character typically is formed with pixels from many pixel lines so that depending upon the font parameters, characters can have different shapes and sizes depending upon the pixels selected for a character both in the X-axis and Y-axis directions. For convenience, some X-axis pixel line near the bottom of a line of characters is defined as the baseline of a character line. Text processors operate to define characters along character lines and use font parameters to actually determine the pixels to be drawn for each character appearing in the character line.
A pixel map is a two-dimensional array of pixels. A pixel is a data structure which can be changed in value (black or white, shades of color, size, brightness and so on) that have physical significance. A pixel is represented by one or more data bits or bytes. A rectangular array pixel map defines each pixel in the array by a set of orthogonal X-axis and Y-axis addresses. Similarly, run-length encoding and other coding methods also define pixels relative to a pixel map.
While the term xe2x80x9ccharacterxe2x80x9d is often used to identify unique shapes representable by a pixel map, the term xe2x80x9ccharacterxe2x80x9d is sometimes limited in meaning to a family of shapes such as an alphabet or a font. In the present specification, however, the term xe2x80x9ccharacterxe2x80x9d refers to any shape (generically referred to as a xe2x80x9cglyphxe2x80x9d) identifiable by a pixel map. A glyph may or may not be associated with a set of similar shapes, such as an alphabet or a font. In the present specification, the term xe2x80x9ccharacterxe2x80x9d is used interchangeably with the term xe2x80x9cglyphxe2x80x9d and term xe2x80x9cglyphxe2x80x9d means any pattern (including symbols, icons or other shapes) representable by a pixel map.
Text processing methods for imaging characters (glyphs) fall into a number of different categories as follows.
A first text processing category performs block transfers (BLTs or blits) of arbitrary data where all code is pre-compiled. This category is the most common method of drawing text via block transfer. Examples of this category are Macintosh QuickDraw DrawText and other general purpose text display systems. Other examples which also fall into this category includes methods that image characters from other representations, such as outlines.
A second text processing category draws characters which, prior to run time, have been compiled manually by humans without use of computational aids specific to text. One example of this category is the Apple II computer executing programs which display large block text on the screen using low-resolution (40xc3x9748) graphics. Each character in the alphabet is described by a character subroutine typically written in BASIC. Words, formed as a combination of characters, are displayed on a screen by executing a combination of character subroutines, one subroutine for each character in the word. Each character subroutine is manually written, by a human programmer, using high level drawing primitives (such as plot points, display vertical lines, and display horizontal lines). Such character subroutines, being manually written for each character, do not permit automatic creation of characters. Furthermore, such manual character subroutines do not translate into code within the instruction set acceptable by the display device and hence directly interfacing with the display device.
A third text processing category compiles a segment of code to perform a data-independent BLT operation for arbitrary pixels in an array without reference to the character content of the data in the array. This method is known as a xe2x80x9ccompiled BLTxe2x80x9d. One example of this category is an ATandT terminal in which block-transfers (BLT or blit) of arbitrary bits or pixels are achieved by first compiling the code for doing a specific instance of a blit (moving, shifting, advancing, clipping, boolean transfer mode, etc.) and then executing the code. This method, however, moves an arbitrary rectangular array of pixels from one place to another place and does not compile text characters into executable code.
A fourth text processing category compiles a segment of code to perform a data-independent BLT of some constant, such as a solid color. This fourth text processing category is a species of the compiled BLT third category and is known as xe2x80x9ccompiled fillxe2x80x9d. The code for a compiled fill can be readily optimized since only a simple, constant pattern is imaged.
In accordance with the above background, many techniques for processing pixels are known, but a need exists for improved methods and apparatus for compiling characters into machine code for display in practical imaging systems.
The present invention is a method and apparatus for receiving glyph data, specifying glyphs according to a pixel map, and for automatically compiling the glyph data to form compiled glyph code for imaging the specified glyphs in an imaging system. The compiled glyph code uses instructions from the instruction set of the imaging system and hence the compiled glyph code directly interfaces with display devices in the imaging system to image the glyphs.
The method of the present invention compiles a segment of code to perform a data-dependent imaging of the glyph data. The compiled code varies as function of the glyph data.
In the method of the present invention, glyph data includes one or more input data bits and the instruction set includes imaging instructions. To compile the input glyph data, the input data bits are compiled to one or more imaging instructions.
In one embodiment of the invention, compiled glyph code functions to speed-up imaging by text processors in an imaging system. In that embodiment, processing control is typically resident with the text processor. The text processor calls the imaging code in which two imaging threads are employed, namely, a foreground thread and a background thread. The foreground thread receives display requests and images the glyphs and the background thread compiles glyphs as needed. If particular glyphs to be imaged have not been compiled, the foreground thread marks the uncompiled glyphs needing to be compiled and schedules time for the background thread to compile the uncompiled glyphs. In this double-threaded embodiment, no significant speed loss is encountered since glyph compiling is a background task.
In another embodiment of the invention, a single-thread imaging sequence is employed. The single-thread imaging sequence receives a display request to image glyphs and compiles any uncompiled glyphs as needed. If particular glyphs to be imaged have not been compiled, the single-thread sequence compiles the uncompiled glyphs. In the single-thread embodiment, glyph compiling delays are experienced whenever an uncompiled glyph is encountered.
In the present invention, the compiled code generation is data-dependent since the compiled glyph code is a function of the input glyph data. Specifically, the compiled glyph code varies as function of variations in the input glyph data, that is, different glyphs defined by the glyph data are compiled to correspondingly different compiled glyph code such that the compiled glyph code can be executed to image the glyphs.
In accordance with the above summary, an improved text processor is provided in which compiled glyph data accelerates the imaging of glyphs.
Other objects, features, and advantages of the present invention will become more apparent in the light of the following detailed description thereof, as illustrated in the drawings.